Repository navigation
perf(core): startup under budget: Paper's loader for the libraries, startup classes loaded ahead - #166
Merged
Conversation
4 of 20 tasks
zacharyk812
force-pushed
the
perf/startup-budget
branch
2 times, most recently
from
November 25, 2026 03:16
aeee71d to
137b81b
Compare
… classes loaded ahead On Paper and Folia from 1.19.3 the jar is also a Paper plugin whose loader (core-loader's PaperLibraryLoader) hands Paper the libraries from the family's cache, skipping Maven's resolver and the legacy class rewriting at every boot. The classes a plugin loads as it starts are recorded on a real server (check.sh --record-startup), mapped to R8's names at build time and loaded by the shim's preload thread before onEnable. xSample on Paper 1.21.11: 252.6 ms to 59.5 ms; on 26.3: 193.9 ms to 39.0 ms. The budgets job fails on startup again.
zacharyk812
force-pushed
the
perf/startup-budget
branch
from
November 25, 2026 03:25
137b81b to
8e4f31b
Compare
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the first plugin's startup under its 150 ms budget, with both options from the perf-budgets entry, and makes startup a failing budget again in the Boot workflow (#162).
scripts/budgets/check.sh, M1 Pro, median of 3 bootspaper-plugin.ymlnames the core'sPaperLibraryLoader(core-loader's newpapersource set, Java 17 class files). The loader takes the libraries from the family's pinned cache inplugins/Xena/libraries/and hands them to Paper asJarLibrarys. Paper then skips Maven's resolver and its legacy class rewriting (Commodore) at every boot. Spigot and older Paper ignore the file and keep usingplugin.yml'slibraries:or the shim. This was already the model for today's plugins, and other plugins can still reach a Paper plugin's API (checked in M1).check.sh --record-startuprecords a real boot's class loading and writes the list (startup_classes.py), with the jar's own classes under their pre-R8 names. The project keeps it asstartup-classes.txt.R8Shrinkmaps it to R8's names and writes it into the jar asMETA-INF/xena/startup-classes.txt, and the shim's preload thread loads those classes (without initializing them) between onLoad and onEnable. A stale list only costs speed.libraries:line to time, the loader reports its own time through the shim'sStartup timesline, andanalyze.pyreads it. Paper building the class loader and the main class is about 8 ms of CPU that no log line bounds; that is written down in DECISIONS.md.boot.yml:--report-onlyis dropped from thebudgetsjob, so being over on startup fails it again.Verified
./gradlew buildpasses.ubuntu-26.04runner-label notice.Not verified here: Paper 1.19.3–1.20.4 on Java 17 (the oldest servers that read paper-plugin.yml), and Paper 1.16.5. The nightly matrix covers 1.16.5.
For each real plugin, its Bukkit module needs:
paper-plugin.ymlwithloader: co.xenastudios.<plugin>.core.loader.paper.PaperLibraryLoaderstartup-classes.txtDECISIONS.md: "Startup under budget".
Part of #123. Part of #162.